< previous page page_105 next page >

Page 105
      frmColor.BackColor = LIGHT_GRAY
      Data1.BackColor = LIGHT_GRAY
      '
      txtOneLine.BackColor = WHITE
      txtOneLine.ForeColor = BLACK
   End If
   '
   ' set to custom colors
   If nSet = 1 Then
      pnlDisplayOnly.BackColor = RED
      pnlPalette.BackColor = RED
      frmColor.BackColor = RED
      Data1.BackColor = RED
      '
      txtOneLine.BackColor = WHITE
      txtOneLine.ForeColor = BLUE
   End If
   '
   ' set to system colors
   If nSet = 2 Then
      pnlDisplayOnly.BackColor = APPLICATION_WORKSPACE
      pnlPalette.BackColor = APPLICATION_WORKSPACE
      frmColor.BackColor = APPLICATION_WORKSPACE
      Data1.BackColor = APPLICATION_WORKSPACE
      '
      txtOneLine.BackColor = WINDOW_BACKGROUND
      txtOneLine.ForeColor = WINDOW_TEXT
   End If
End Sub
Finally, add this line of code to the System button to activate the system color scheme:
Sub cmdSystem_Click ()
   SetColors 2
End Sub
Save and run the program. When you click the System button, you'll see the color scheme you selected in the Control Panel as the color scheme for this application. Now, while the program is still running, start the Control Panel application and select a new color scheme for Windows. Your Visual Basic program instantly changes its own color scheme!
Summary
Today you have learned the following about creating data entry forms with Visual Basic bound data controls.
The Visual Basic data control has five database-related properties. Three refer to the database and two refer to the Dynaset.
· The database properties of the Visual Basic data control are DatabaseName, which is used to select the database to access; Exclusive, which is used to prevent other

 
< previous page page_105 next page >

If you like this book, buy it!